package spring.cloud.tasks.tasks_manager.domain;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.curator.framework.CuratorFramework;

@Slf4j
@Setter
@Getter
public final class NameSpaceZooKeeperClient {
    private String nameSpace;
    private String zooKeeperAddress;
    private boolean connected;
    private transient CuratorFramework curatorFramework;

    public void close() throws Exception {
        if (curatorFramework != null) {
            curatorFramework.close();
            curatorFramework = null;
            connected = false;
        }
    }

}
